Thematic Layer Inputs Normalized to Consistent Scale for Suitability
This week’s assignment will encompass the following concepts covered in Class 9 lecture & lab:
Class 9 Lecture and Assignment Materials:
Class 9 Lab Materials:
This week’s readings will include 1 section from the Essentials of Geographic Information Systems textbook.
The class 9 quiz will cover only content from the Essentials of Geographic Information Systems textbook as follows:
Chapter 7 - Spatial Analysis of Raster Data
Context Reading (following material will not be quizzed, but helpful to understand assignment context):
Finding Suitable Locations | Chapter 2 (Suitability Overview)
What is Map Algebra?
Raster Calculator Overview
Raster Calculator Appendix - Map Algebra
Review Class 9 Lab to ensure that you have a firm understanding of the following concepts:
All suitability analysis has multiple criteria across thematic layers. Read the project overview Assignment Suitability Overview to understand the criteria and goals of the project before proceeding into detailed steps. Below is a short listing of the project criteria:
IDP Camp Suitability:
2 and 7 degrees of slope.5 KM of roads.25 KM of urban centers.5 KM outside of the highly urban centers.10 KM of Unexploded ordnance (UXO)10,000 to 20,000 displaced persons. Note 2: For those on Windows machines, the standalone QGIS download offers two application options - one without GRASS tools and one with GRASS tools bundled. For this assignment, you will need GRASS tools activated to accomplish one of the conversions - vector to raster. You can access the QGIS instance with GRASS tool bundled from the Windows Start Menu, navigating to QGIS folder and choosing the correct QGIS version:
GRASS Tool Integration w/in QGIS
Step 1, as notated in the C9 Assignment Suitability Overview, the first criteria for accessing suitable locations for IDP camps in Uganda involves determining suitable slope. During Class 5, slope was addressed so the process will be similar here.
areas with a gradient (slope) of between 2 and 7 degreesTo start, connect your data folder for the assignment, and create an exports folder to place your processing outputs throughout the project:
Connect Data Direction to QGIS Project
Import the hdr.adf raster file into Map canvas. These are the raw elevation values supplied by the SRTM shuttle satellite in raster format. They are currently in a proprietary ESRI .hdr labeling format, often referred to as ESRI BIL format.
Import Raster Layer
hdr.adf raster placed into Layers Panel:Import Raster Layer
Slope from Raster > Terrain Analysis > Slope. Make sure to utilize a Z value of 0.00000898 which is the value used for locations near zero latitude which is the case for Uganda. More on Z values for raster data in WGS84 can be found in the furter reference section at bottom of assignment:Slope Tool
Slope as Uganda_Slope in GeoTIFF format using Z factor of 0.00000898 into exports folder:Slope with Z Factor Applied
Explanation of Z Factor Here
Its important to review the raster values that are produced by a geoprocess. By showing actual values under pseudocolor ramp, both the values array can be seen in the Layers panel as well a vividly in the raster within Map canvas:
Review Raster Result
Note that the
slopevalues are 0 to 72.4; these units are degrees of slope. Towards the end of the process, threshold valuesbetween 2 and 7 degreeswill be selected as part of the model suitability for IDP camp locations. Save your.qgsproject and move to Step 2 below:
Review Raster Result
Step 2, following the slope analysis above, the second criteria theme is sites in proximity to roads; in this specific case Within 5 Kilometers of a Road(s). To start, input Roads.shp and run a BUFFER analysis for 5 KM upon Roads.shp:
Buffer Process
Roads.shp is projected to its correct UTM zone, thus units are in meters. Utilize 5000 meters as distance and 30 as Segments input; name output roads_5km_buff.shp:Distance Buffer
BUFFER results, ensuring correct distance and fully dissolved 1 polygon feature:Distance Buffer
Step 3, following the slope and roads BUFFER analysis, the third criteria theme is sites in proximity to markets (Populated Places will act as proxy for Markets); in this specific case Within 25 Kilometers of a Market(s). To start, input Populated_Places.shp and run a BUFFER analysis for 25 KM upon Populated_Places.shp:
Distance Buffer
Populated_Places.shp is projected to its correct UTM zone, thus units are in meters. Utilize 25000 meters as distance and 30 as Segments input; output as Market_Access.shp:Distance Buffer
BUFFER results, ensuring correct distance and fully dissolved 1 polygon feature:Buffer Dissolve
Step 4, before proceeding to other criteria, an intermediate step of INTERSECT between roads_5km_buff.shp and Market_Access.shp will produce suitable areas that meet 2 criteria - proximity to roads and markets:
Intersection
INTERSECT inputs and output as Road_Market_Access.shp. *Note: Buffer is the default addition in Layers Panel- to be sure you have the correct inputs, pull roads_5km_buff.shp and Market_Access.shp directly into Layers Panel before proceeding:Intersection
Dissolve Result
Step 4, unlike the criteria leading to Road_Market_Access.shp where the proximity is a value, there is also the reverse for risk and unsuitability within the current suitability feature - specifically the presence of UXO and urban threats. Two more BUFFER analyses will be done based on the following criteria:
Urban Hazard (UrbanHazard.shp) as defined as 5 KM from Populated_Places.shp:
Distance Buffer
UXO Distance (UXOHazards.shp) as defined as 10 KM from UXOs.shp
Distance Buffer
BUFFER results, ensuring correct distance and fully dissolved 1 polygon features for both UrbanHazard.shp and UXOHazards.shp:Dissolve Result
Step 5, There now exists both ‘suitable access’ and ‘risk’ that can be overlaid to find the DIFFERENCE and produce a final result that is the Road and Market access desired (Road_Market_Access.shp) but without the risk of UrbanHazard.shp and UXOHazards.shp. To do this, enact DIFFERENCE twice upon Road_Market_Access.shp, saving the first DIFFERENCE as Diff_1, and the second as Road_Market_Access_final.shp:
DIFFERENCE tool:Difference
DIFFERENCE, ensuring that the input and difference layers are correctly ordered. Output as diff_1.shp to exports folder:Difference Export
DIFFERENCE, ensuring that the input and difference layers are correctly ordered. Make sure the input layer is now diff_1.shp as it has been updated by the first DIFFERENCE. Output as Road_Market_Access_final.shp to exports folder:Difference
DIFFERENCE results in Road_Market_Access_final.shp which should now show missing areas where both UrbanHazard.shp and UXOHazards.shp used to exist:Difference Result
Step 6, at this juncture, slope exists in raster format and the suitability developed thus far exists in vector format. There are several ways to proceed to get the final suitability. One option is to convert to raster and utilize the raster calculator to find the final suitable locations.
1 into the attribute table for Road_Market_Access_final.shp via Field Calculator in a new field value:Prepare Column for Vector > Raster Conversion
value, now containing 1:Table Result
The v.to.rast tool option can be utilized under Processing Toolbox to enact the conversion:
Vector > Raster Tool
The following parameters are important to determine. Utilize cell size 90 (90 meters) which is the same cell size as the slope raster. Its critical before working with a raster calculator that all input rasters feature the same cell size:
Road_Market_Access_finalpolygonval190AccessRaster.tifRaster Calculator Parameters
Note: in the conversion step above, we overrode the attribute table value of
1by usingvalas source. There are several ways to input the values to the new raster. By explicitly coding in the1value to the vector attribute table before rasterization, we cover the basis for flexibility in thev.to.rasttool.
90 meter cells where value 1 is suitable:Conversion Result
Step 7, at this juncture, both slope and suitable access are in raster format; raster calculator can now be employed to find the condition where slope = areas with a gradient (slope) of between 2 and 7 degrees and AccessRaster.tif = value of 1 which is the value of suitability of road and market access minus the hazard and urban risk geographies. Use the following parameters in raster calculator:
Parameters:
Output format = GeoTIFF
Output CRS can be the AccessRaster CRS = EPSG:32636
Output = raster_suitability.tif to exports
The following equation can be used in raster calculator:
( "AccessRaster@1" = 1 ) AND ( "Uganda_Slope@1" >= 2 ) AND ( "Uganda_Slope@1" <= 7 )
Raster Calculator
Note: in the image above, the naming convention for the inputs is slightly different. If you are producing errors in this step, make sure to check that the function inputs are the same naming convention as the input layers in your own project.
1 value cells should now represent AccessRaster, with the range of suitable cells (>=2 asnd <=7) for slope intermingled within the larger shape of AccessRaster:Raster Result
Step 8, the mapping will be for one district within Uganda - Gulu. At this juncture, the raster result can be clipped to just the project area. In order to do so, a clipping layer must be produced which is also the district boundary. Additionally, this export can also be used for the final mapping cartographic design. Export this feature from the Districts.shp as GULU.shp:
SQL using Select by Expression. Export as GULU.shp:SQL Selection
Note: access to selection tools can always be found via Processing Toolbox:
Select by Expression
GULU.shp overlaid to the Raster_Suitability.tif:Gulu + Raster Suitability
Note: at the early stage, we can see where suitable locations will be located (black cells) within
GULU.shp.
Raster_Suitability.tifgulu_suitable.tifGULU.shpExtraction Parameters
gulu_suitable.tif result:Result
gulu_suitable.tif is a boolean raster layer ( originally Raster_Suitability.tif) of values 1 for suitable and 0 for unsuitable across the full extent of the inputs, now only within district GULU. However, IDP camps still need to meet certain size and capacity thresholds; these calculations will be done in vector format. In order to do these areal calculations, a conversion back to vector format will be performed:Polygonize
Parameters:
gulu_suitable.tifgulu_suitable)_v.shp to exportsPolygonize Parameters
gulu_suitable_v.shp now has two values in the DN column - 1 for vector polygons that are suitable and 0 for vector polygons that are unsuitable. First, Select by Expression those features which are 1, suitable, and export this selection as SuitableAreas.shp:Select by Expression
SuitableAreas.shp and check the result:Export Selection
AREA must be established in the attribute table for each polygon feature. There are several ways to accomplish AREA as we’ve done in past assignments. Utilize Add Geometry Attributes as the feature is currently projected. This will return square area as square meters (export to temporary memory):Geometry Attributes for Suitability Result
Note: if you need to Fix Geometries go ahead and do so, and return to Add Geometry Attributes.
AREA in attribute table:Area Attribute
Step 11, the capacity calculation is based on area developed in Step 10 - 45 sq meters per person - a basic requirement of shelter:
CAPACITY utilizing the following equation "area"/45:Capacity Calculation
Step 12, the final criteria of the project is contiguous areas that meet all criteria AND feature a CAPACITY between 10,000 and 20,000 IDP persons. The SQL formula for this Selection by Expression is as follows:
"CAPACITY" >=10000.000 AND "CAPACITY" <=20000.000Imgur
Export the selection to GULU_final_suitability.shp - make sure to check Save only selected features
Check Result:
Imgur
Vector > Geometry Tools > Centroids:Centroids Tool
Centroids Tool Parameters
CAPACITY:Capacity Quantity in Legend
Centroids can represent Capacity Quantity
Note: for proportional symbolization, refer to thematic mapping, assignment 3.
Refer to Class 9 Assignment Examples for guidance on design and layout. Note that the last map does not utilize proportional symbolization, but the other examples do indeed utilize this technique.
The final map will be uploaded to the assignment submission section for Class 9. Ensure that a title and legend are included.